// 8. [整除数取模] Standings   https://oj.rnd.huawei.com/problems/8/details
// 每一轮的比赛中他的排名R都能整除参赛人数N

#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;

void getRank(int n) {
  set<int> stNumber;
  for (int i = 1; i <= n / 2; i++) {
    if (n % i == 0) {
      stNumber.insert(i);
    }
  }
  stNumber.insert(n);
  printf("%d", stNumber.size());
  for (auto st : stNumber) {
    printf(" %d", st);
  }
  printf("\n");
}

int main() {
  int num = 0;
  while (cin >> num) {
    getRank(num);
  }
  return 0;
}
